import { GET,POST,DELETE,PUT } from '../index';
import { RouteConfig } from '@/types/router';
let baseUrl = process.env.APP_NOAH_GRAPH_URL

/**
 * 创建指标模型查询
 */
export const createMetricQuery = (data: any) => {
  return POST<any, []>( baseUrl + '/ai/metric-query/create', data);
};

/**
 * 更新指标模型查询
 */
export const updateMetricQuery = (data: any) => {
  return PUT<any, []>( baseUrl + '/ai/metric-query/update', data);
};

/**
 * 删除指标模型查询
 */
export const deleteMetricQuery = (params: any) => {
  return DELETE<any, []>( baseUrl + '/ai/metric-query/delete', params);
};

/**
 * 指标模型查询详情
 */
export const getMetricQueryInfo = (params: any) => {
  return GET<any, []>( baseUrl + '/ai/metric-query/get', params);
};

/**
 * 数据源列表
 */
export const metricTree = (data: any = {}) => {
  return GET<any, RouteConfig>(`${baseUrl}/ai/metric-query/metricTree`, data);
};
 
/**
 * sql执行
 */
export const executeSql = (data: any) => {
  return POST<any, []>( baseUrl + '/settings/connect/executeSql', data);
};
